package com.gem.day05;

public class ComputerTest {
	public static void main(String[] args) {
		//创建没有显示器的电脑
		//Computer computer = new Computer("联想", 4000.0, "这是一台国产笔记本电脑");

		//创建一个带显示器的电脑
		/*Screen screen = new Screen("LED", 17, "三星");
		Computer computer = new Computer("联想", 4000.0, "这是一台国产笔记本电脑", screen);*/

		//匿名对象创建
		Computer computer = new Computer("联想", 40000.0, "这是一台国产笔记本电脑", new Screen("LED", 15, "三星"));
		System.out.println(computer);

		System.out.println("------------------------------------------");

		//1.获取电脑品牌
		System.out.println(computer.getBrand());

		//2.修改电脑价格
		computer.setPrice(9000);
		System.out.println(computer.getPrice());

		//3.获取电脑显示器的尺寸
		System.out.println(computer.getScreen().getSize());

		//4.修改电脑显示器类型
		computer.getScreen().setType("LCD");
	}
}
